package day7.nimingneibulei.fight;

public class test {
    public static void main(String[] args)
    {
       // student s1=new student();
        //teacher t1=new teacher();
        //func(s1);

        people p1=new people() {
            @Override
            public void swiming() {
                System.out.println("第一种实现");
            }
        };

        func(new people()    //匿名内部类是个可以是任何类的子类
        {
            @Override
            public void swiming() {
                System.out.println("我直接通过匿名内部类创建一个子类匿名对象传给父亲");
            }
        });
    }


    public static void func(people p1)
    {
        p1.swiming();
    }


}
